package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.view.View;
import android.widget.FrameLayout.LayoutParams;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.framework.widget.RoundImageView;
import com.huawei.appmarket.service.store.awk.bean.SubstanceGifCardBean;
import o.azb;
import o.cgz;
import o.epv;
import o.eqx;
import o.ewm.j;

public class SubstanceGifCard extends BaseDistCard {
    private RoundImageView ˋ;
    private SubstanceGifCardBean ॱॱ;

    public SubstanceGifCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (RoundImageView) view.findViewById(j.ʽﹶ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof SubstanceGifCardBean) {
            this.ॱॱ = (SubstanceGifCardBean) cardBean;
            ˋ();
            eqx.ˏ(this.ˋ, this.ॱॱ.ˊ());
        }
    }

    private void ˋ() {
        int ॱ = this.ॱॱ.ॱ();
        int ˊ = azb.ˊ(this.ʼॱ);
        int ˏ = azb.ˏ(this.ʼॱ);
        int ʻ = epv.ʻ(this.ʼॱ);
        LayoutParams layoutParams = (LayoutParams) this.ˋ.getLayoutParams();
        if (ॱ == 0) {
            layoutParams.setMargins(ˊ, 0, ˏ, 0);
            this.ˋ.setRadius(ʻ);
        }
        this.ˋ.setLayoutParams(layoutParams);
    }
}
